<?php

namespace App\Http\Controllers;

use App\Http\Requests\GoodCateStoreRequest;
use App\Http\Requests\GoodCateUpdateRequest;
use App\Services\GoodCateService;

class GoodCateController extends Controller
{
    /**
     * 商品分类列表
     */
    public function cate() {
        return view('goods.cate');
    }
    /**
     * 商品分类列表api
     */
    public function cateList(GoodCateService $goodCateService) {
        return json_encode($goodCateService->getCateList());
    }
    /**
     * 保存商品分类api
     */
    public function cateStore(GoodCateService $goodCateService, GoodCateStoreRequest $request) {
        return $goodCateService->goodCateStore($request);
    }
    /**
     * 更新商品分类api
     */
    public function cateUpdate(GoodCateService $goodCateService, GoodCateUpdateRequest $request) {
        return $goodCateService->goodCateUpdate($request);
    }
}
